#include "pch.h"
#include "Events.h"
#include "Engine/Engine.h"

namespace TryEngine
{
    // callback function definition
    void WindowCloseCallback(GLFWwindow* window);

    Events::Events() {}

    Events::~Events() {}

    void Events::Poll()
    {
        glfwPollEvents();
    }

    void Events::Initialize()
    {
        GLFWwindow& window = Core.Window();
        glfwSetWindowCloseCallback(&window, WindowCloseCallback);
    }

    void WindowCloseCallback(GLFWwindow* window)
    {
        Core.Quit();
    }
}